#pragma once
#include <iostream>
#include <string>
#include "Addr.hpp"
class task
{
public:
    task(){}
    task(const std::string& message, int sockfd)
        :_message(message), _sockfd(sockfd)
    {}
    void run()
    {
        // std::cout << " run " << std::endl;
        Addr::GetInstance()->Send(_message, _sockfd);
    }
    void operator()()
    {
        run();
    }
    std::string GetMessage()
    {
        return _message;
    }
private:
    std::string _message;
    int _sockfd;
};